function calculate() {

  var input1 = parseFloat(document.getElementById("input1").value);   //μp
  var input2 = parseFloat(document.getElementById("input2").value);   //x
  var input3 = parseFloat(document.getElementById("input3").value);  //h
  // var input4 = parseFloat(document.getElementById("input4").value);  //θ
  //console.log("input1", input1);


  if (!input1 ) input1  = 0;
  if (!input2 ) input2  = 0;
  if (!input3 ) input3  = 0;  
  //if (!input4) { 
  //   input4 = 0;
  // }

  // v的结果
 let result = (Math.sqrt(2*g)*input1*(Math.sqrt(input3+input2/input1-Math.sqrt(input3)))*3.6).toFixed(2);

  if (result == 'NaN') {
    result = 0
    alert('请按要求输入数据！')
    location.reload()
  }

  document.getElementById("result").textContent = result;
}